package com.winning.dps.rda.standardManage.service.impl;

import com.winning.dps.rda.standardManage.entity.Log;
import com.winning.dps.rda.standardManage.entity.User;
import com.winning.dps.rda.standardManage.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private JdbcTemplate appJdbcTemplate;

    @Autowired
    private JdbcTemplate dsJdbcTemplate;

    /**
     *
     */
    @Override
    public void multiQuery() {
        List<User> maps = appJdbcTemplate.query("select * from person", new BeanPropertyRowMapper<>(User.class));
        System.out.println(maps);

        List<Log> maps2 = dsJdbcTemplate.query("select * from log", new BeanPropertyRowMapper<>(Log.class));
        System.out.println(maps2);
    }


}
